/* START of version upgrade paste of previously defined CONSTANTS from util.php3 - if you are installing for the first time then just ignore this line */
/* CONSTANT declarations - DO NOT CHANGE UPPERCASE CONSTANTS */
/* Change lowercase values ONLY */
/* values you may change are marked with the comment " - modify" */
define("TABLESCHOLARS", "Scholars" ); /* the Scholars info*/
define("TABLESCHOLARS_NEW", "Scholars_new" ); /* the Scholars info*/
define("TABLECONTACT", "contactInfo" ); /* the Scholar's contact info*/
define("TABLETEACHERS", "Teachers" ); /* the Teachers info*/
define("TABLESTUDENTS", "Students" ); /* the Students info*/
define("TABLEBOOKS", "Books" ); /* the Books info*/
define("TABLEREFS", "Biblio" ); /* the Refs info*/
define("TABLEASABAH", "Asabah" ); /* the Asabah info*/
define("TABLEALTHKAT", "Althkat" ); /* the Althkat info*/
define("TABLETARIKH", "Tarikh" ); /* the Tarikhul Kabir info*/
define("TABLEMIZAN", "Mizan" ); /* the Lisan al-Mizan info*/
define("TABLEIBNSAD", "ibnSad" ); /* the Tabaqat ibn Sad info*/
define("TABLESEER", "Seer" ); /* the See A'lam al-nubala info*/
define("TABLETAHZEEB", "Tahzeeb" ); /* the Tahzeeb al-Tahzeeb info*/
define("TABLEMEZAN", "Mezan" ); /* the Mezan al-A'tadal info*/
define("TABLETAQRIB", "Taqrib" ); /* the Tahzeeb al-Tahzeeb info*/
define("TABLEKAMAL", "TadheebAlKamal" ); /* the Tahzeeb al-Kamal info*/
define("NARRATORS", "Narrators" ); /* the Narrator List*/
define("NAMES", "Names" ); /* the Narrator List*/
define("TABLESCHOLARSADD", "ScholarsAdd" );
define("TABLEBOOKSADD", "BooksAdd" );
define("TABLEHADITH", "Hadith" ); /* the Refs info*/
define("TABLEHADITH2", "Hadith2" ); /* the Hadith info*/
define("TABLEHADITH3", "Hadith3" ); /* the Hadith info*/
define("TABLEHADITHBOOKS", "HadithBooks" ); /* the Refs info*/
define("TABLEUNKNOWNHADITH", "UnknownHadith" );
define("INSTALLPATH", "http://muslimscholars.info"); /* The full path to and including your install directory - be sure to include a trailing slash like "/" - modify */
define("UPLOADPATH","upload/"); //path where poster are uploaded
/* Who you are */
define("WEBMASTER", "webmaster@muslim-scholars.info" ); /* The webmasters email address - modify */
define("REQUESTEMAIL", "request@satamaticsIsatM2M.com" ); /* The webmasters email address - modify */
define("SALESEMAIL", "nicksalvi@satamaticsusa.com" ); /* The webmasters email address - modify */
define("AGENTEMAIL", "farrukh@muslim-scholars.info" ); /* The webmasters email address - modify */
define("COMPANY", "Muslim-scholars" ); /* The name of your organization, used in page titles etc - modify */
define("ADDRESS", "4503 W. DeYoung St. Suite 204C Marion, IL 62959" );
define("SALESPHONE", "1-877-SAT-MATD or 301-560-4716 (outside US)" ); /* Your phone number for sales as on advertise.php3, when a record is added this will show - modify */
define("SALESFAX", "360-246-7263" ); /* Your Fax number for sales as on advertise.php3, when a record is added this will show - modify */
//define("SALESPHONE", "732-926-9729" ); /* Your phone number for sales as on advertise.php3, when a record is added this will show - modify */
//define("SALESFAX", "732-926-0132" ); /* Your Fax number for sales as on advertise.php3, when a record is added this will show - modify */
//define("ADDRESS", "156 Carlton Ave., Piscataway, NJ 08854." );
/* How your phpYellow Pages implementation works */
define( "SSL", "on"); /* whether or not you require SSL 3.0 validation on admin login */
define("EMAILONLISTING", "yes"); /* if you want the WEBMASTER notified of every new listing added or modified then this value should be "yes" - modify */
define("EMAILONCUSTOMER", "yes"); /* if you want the SALES notified of every new customer added or modified then this value should be "yes" - modify */
define("EMAILTOCUSTOMERONLISTING", "yes"); /* if you want the Customer notified of every new listing added or modified then this value should be "yes" - modify */
define("EMAILTOCUSTOMER", "yes"); /* if you want the Customer be notified of new Customer added or modified then this value should be "yes" - modify */
define("EMAILTOAGENTONLISTING", "yes"); /* if you want the Agent notified of every new listing added or modified then this value should be "yes" - modify */
define("EMAILTOAGENTONCUSTOMER", "yes"); /*if you want the Agent be notified of new Customer added or modified then this value should be "yes" - modify */
define("EMAILTOAGENT", "yes"); /*if you want the Agent be notified of new Customer added or modified then this value should be "yes" - modify */
define("YOURPHPYELLOWNAME", "satamaticsIsatM2M.com"); /* the name you call your implementation of phpYellow, used in html page titles and email - modify */
define("RECORDSPERPAGE", "20"); /* The number of results per page in any search - modify if wanted */
define("SHOWSQL", "no" ); /* DO NOT CHANGE. for debugging, choose to show the sql queries. Anything but "no" will cause display of sql in admin results only */
/* END of version upgrade paste of previously defined CONSTANTS from util.php3 - if you are installing for the first time then just ignore this line */
/* Database and connectivity */
//muslimscholars.db.5696160.hostedresource.com
define("DBNAME2", "dplus" ); /* your mySQL database name - modify */
define("DBPASSWORD2", "sat101" ); /* the password to get into your mysql database - modify */
define("USER2", "satamatics" ); /* the name of your mysql user, often made the same as your internet user account - modify */
define("HOSTSERVER2", "mysql"); /* the name of your database host server - modify */
//define("DBNAME", "dplus" ); /* your mySQL database name - modify */
//define("DBNAME_BACKUP", "Backup" ); /* your mySQL database name - modify */
//define("DBPASSWORD", "sat201" ); /* the password to get into your mysql database - modify */
//define("USER", "satamati" ); /* the name of your mysql user, often made the same as your internet user account - modify */
//define("HOSTSERVER", "localhost"); /* the name of your database host server - modify */
define("DBNAME", "muslkwrm_msd_DB" ); /* your mySQL database name - modify */
define("HOSTSERVER", "localhost"); /* the name of your database host server - modify */
define("DBPASSWORD", "MSdb@2011CE" ); /* the password to get into your mysql database - modify */
define("USER", "muslkwrm_muslimscholars" ); /* the name of your mysql user, often made the same as your internet user account - modify */
//define("DBPASSWORD", "alcpme" ); /* the password to get into your mysql database - modify */
//define("USER", "root" ); /* the name of your mysql user, often made the same as your internet user account - modify */
/* Utility routines for MySQL from http://www.vtwebwizard.com - Thanks! */
class MySQL_class {
var $db, $id, $result, $rows, $data, $a_rows, $errors, $errStr;
var $user, $pass, $host;
function mysqli_field_name($result, $field_offset)
{
$properties = mysqli_fetch_field_direct($result, $field_offset);
return is_object($properties) ? $properties->name : null;
}
function Setup ($user, $pass) {
$this->user = $user;
$this->pass = $pass;
}
function Create ($db) {
if (!$this->user) {
$this->user = USER;
}
if (!$this->pass) {
$this->pass = DBPASSWORD;
}
if (!$this->db) {
$this->db = $db;
}
if (!$this->host) {
$this->host = HOSTSERVER;
}
$this->id = mysqli_connect($this->host, $this->user, $this->pass) or
$this->MySQL_ErrorMsg("Unable to connect to MySQL server: $this->host : '$SERVER_NAME'");
$this->selectdb($db);
}
function Create2 ($db, $user, $password, $host) {
if (!$this->user) {
$this->user = $user;
}
if (!$this->pass) {
$this->pass = $password;
}
if (!$this->host) {
$this->host = $host;
}
$this->id = mysqli_connect($this->host, $this->user, $this->pass) or
$this->MySQL_ErrorMsg("Unable to connect to MySQL server: $this->host : '$SERVER_NAME'");
$this->selectdb($db);
}
function SelectDB ($db) {
$this->errors = 0;
$this->errStr = "Ok";
mysqli_select_db($this->id, $db ) or
$this->MySQL_ErrorMsg ("Unable to select database: $db");
}
/* Use this function is the query will return multiple rows. Use the Fetch
routine to loop through those rows. */
function Query ($query) {
mysqli_query($this->id, "SET CHARACTER_SET_RESULTS=NULL");
//echo $query;
$this->result = mysqli_query($this->id, $query) or
$this->MySQL_ErrorMsg ("Bad query: $query");
//if ($this->result = mysqli_query($this->id, $query)) {
$this->rows = mysqli_num_rows($this->result);
$this->a_rows = mysqli_affected_rows($this->id);
//mysqli_free_result($this->result);
//}
}
function Query2 ($query) {
mysqli_query($this->id, "SET CHARACTER_SET_RESULTS=NULL");
$this->result = mysqli_query($this->id, $query) or
$this->MySQL_ErrorMsg ("Bad query2: $query");
$this->rows = mysqli_num_rows($this->result);
$this->a_rows = mysqli_affected_rows($this->id);
}
/* Use this function if the query will only return a
single data element. */
function QueryItem ($query) {
mysqli_query($this->id, "SET CHARACTER_SET_RESULTS=NULL");
$this->result = mysqli_query($this->id, $query) or
$this->MySQL_ErrorMsg ("Unable to perform query: $query");
$this->rows = mysqli_num_rows($this->result);
$this->a_rows = mysqli_affected_rows($this->id);
$this->data = mysqli_fetch_array($this->result);
// or $this->MySQL_ErrorMsg ("Unable to fetch data from query: $query");
return($this->data[0]);
}
/* This function is useful if the query will only return a
single row. */
function QueryRow ($query) {
mysqli_query($this->id, "SET CHARACTER_SET_RESULTS=NULL");
$this->result = mysqli_query($this->id, $query) or
$this->MySQL_ErrorMsg ("Unable to perform query: $query");
$this->rows = mysqli_num_rows($this->result);
$this->a_rows = mysqli_affected_rows($this->id);
$this->data = mysqli_fetch_array($this->result);
// or $this->MySQL_ErrorMsg ("Unable to fetch data from query: $query");
return($this->data);
}
function Fetch ($row) {
mysqli_data_seek($this->result, $row) or
$this->MySQL_ErrorMsg ("Unable to seek data row: $row");
$this->data = mysqli_fetch_array($this->result) or
$this->MySQL_ErrorMsg ("Unable to fetch row: $row");
}
function Insert ($query) {
//$query2 = mysqli_real_escape_string($this->id, $query);
//echo "\r\n------------------".$query2;
$this->result = mysqli_query($this->id, $query) or
$this->MySQL_ErrorMsg ("Unable to perform insert: $query2");
$this->a_rows = mysqli_affected_rows($this->id);
}
function Update ($query) {
$this->result = mysqli_query($query, $this->id) or
$this->MySQL_ErrorMsg ("Unable to perform update: $query");
$this->a_rows = mysqli_affected_rows($this->id);
}
function Delete ($query) {
$this->result = mysql_query($this->id, $query) or
$this->MySQL_ErrorMsg ("Unable to perform Delete: $query");
$this->a_rows = mysql_affected_rows($this->id);
}
/* ********************************************************************
* MySQL_ErrorMsg
*
* Print out an MySQL error message
*
*/
function MySQL_ErrorMsg ($msg) {
/* Close out a bunch of HTML constructs which might prevent
the HTML page from displaying the error text. */
//echo("\n");
//echo("\n");
/* Display the error message */
$this->errors = 1;
$this->errStr = mysqli_error();
//$db_err = 1;
$text = "$msg ";
$text .= $this->errStr." ";
// print($text);
return($text);
}
}
/* check for unwanted characters in user input query */
function verifyData ($query) {
if($query){
$query = str_replace ("%", "", $query);
//$query = str_replace ("_", "", $query);
$query = str_replace (">", "", $query);
$query = str_replace ("<", "", $query);
$query = str_replace ("|", "", $query);
$query = str_replace ("`", "", $query);
//$query = str_replace ("\\", "", $query); incompatible with addslashes
$query = str_replace ("+", "", $query);
$query = str_replace ("?", "", $query);
$query = str_replace ("^", "", $query);
return $query;
}else{
exit;
}
}
function getRegionList($db,$sql, $region)
{
if (strlen($sql)<5) return("");
$result = mysqli_query($db, $sql);
if ($myrow = mysqli_fetch_array($result)) { // display list if there are records to display
do {
$count++;
$area=$myrow["RegionCode"];
$dash="";
if ($area==0 || $area==70 || $area==99) $dash="---";
if ($area==$region)
printf("\n",$area,$dash,$myrow["RegionName"]);
else
printf("\n",$area,$dash,$myrow["RegionName"],$dash);
} while ($myrow = mysqli_fetch_array($result));
//printf("%d records selected\n",$count);
}
return($count);
}
function findInDB($sql2,$names, $arabic=0, $view=0)
{
GLOBAL $colors;
$fId = trim(strtok($names , ","));
$name = "";
$comma = "";
$comma2 = " ";
while (strlen($fId)>0)
{
if ((string)$fId === (string)(int)$fId)
{
if ($arabic==1)
$sName = $sql2->QueryItem("select otherName from ".TABLESCHOLARS." where id='$fId'");
else
$sName = $sql2->QueryItem("select famousName from ".TABLESCHOLARS." where id='$fId'");
//$sName = $sql2->data[0];
//$oName = $sql2->data[1];
$rk = (int)($fId/10000) + 1;
$color = $colors[$rk];
if ($view==1)
$name .= $comma."$sName";
else {
if ($fId>=9990 && $fId<=9999)
$name .= $comma."$sName";
else
$name .= $comma."$sName";
//if (strlen($oName)>3)
// $name .= $comma2."$oName";
}
}
else
{
$name .= $comma.$fId;
}
$fId = trim(strtok(","));
$comma = ", ";
}
return($name);
}
function findInDB3($sql2,$names,$rank=-1,$arabic=0,$gap=", ")
{
GLOBAL $colors;
$fId = trim(strtok($names, ","));
$name = "";
$comma = "";
$comma2 = " ";
$count=0;
$size="-1";
if ($arabic==1) $size="+1";
while (strlen($fId)>0)
{
if ((string)$fId === (string)(int)$fId)
{
$rk = (int)($fId/10000) + 1;
if ($rk==$rank || $rank==-1)
{
$color = $colors[$rk];
$sName = $sql2->QueryRow("select famousName,otherName,birthDate,deathDate,liveCity,tags,kunya from ".TABLESCHOLARS." where id='$fId'");
$nm = $sName[$arabic];
$fName = $sName[0];
$dob = trim($sName[2]);
$dod = trim($sName[3]);
$dbd ="";
if (strlen($dob)>2 && strlen($dod)>2) $dbd = "[$dob - $dod]";
else if (strlen($dod)>2) $dbd = "[d. $dod]";
$cities = trim($sName[4]);
$kunya = trim($sName[6]);
$cap = "$fName,$kunya $dbd [$cities]";
$name .= $comma."".$nm."";
$comma = $gap;
$count++;
if ($count>5) break;
}
}
$fId = trim(strtok(","));
}
return($name);
}
function getIds($names, $rank=-1)
{
$fId = trim(strtok($names , ","));
if (strlen($fId)==0) $fId = trim($names);
$name = "";
$comma = "";
$comma2 = " ";
while (strlen($fId)>0)
{
if ((string)$fId === (string)(int)$fId)
{
$rk = (int)($fId/10000) + 1;
if ($rk==$rank || $rank==-1)
{
$name .= $comma.$fId;
$comma=",";
}
}
$fId = trim(strtok(","));
}
return($name);
}
function findInDB2($sql2,$names,$mID=0)
{
GLOBAL $colors;
$name = "";
$fId = trim(strtok($names , ","));
if ($fId=="")
$name = "Unknown";
$no=1;
$comma = "";
$comma2 = " ";
while (strlen($fId)>0)
{
if ((string)$fId === (string)(int)$fId)
{
$dd = $sql2->QueryRow("select famousName,otherName,RefId,miscIds from ".TABLESCHOLARS." where id='$fId'");
$sName = $dd[0];
$oName = $dd[1];
$idd = $dd[2]."-".$dd[3];
$rk = (int)($fId/10000) + 1;
$color = $colors[$rk];
//$name .= $comma."$sName";
if ($fId>=9990 && $fId<=9999)
$name .= $comma."$sName";
else
$name .= $comma."$sName";
if (strlen($oName)>3)
$name .= $comma2."$oName";
if ($mID>0)
$name .= ".";
//$name .= ".";
}
else
{
$name .= $comma.$fId;
}
$fId = trim(strtok(","));
$no++;
$comma = " $no)";
//$comma2 = " ";
}
return($name);
}
function linkTags($tags)
{
$fId = trim(strtok($tags, ","));
$tag = str_replace(' ', '%20', $fId);
$name = "";
$comma = "";
while (strlen($fId)>0)
{
$name .= $comma."$fId";
$fId = trim(strtok(","));
$tag = str_replace(' ', '%20', $fId);
$comma = ", ";
}
return($name);
}
function drawBox($align,$size,$heading,$body)
{
print("
\n");
print("
$heading
");
print("
\n");
print("
$body
\n
\n");
}
function processEntry($sql2,$info, $width, $upto=0)
{
$count=0;
$chds="";
$infos = explode(",",$info);
foreach ($infos as $chd)
{
$chd = trim($chd);
if (strlen($chd)<1) continue;
if ((string)$chd === (string)(int)$chd)
{
$child = $sql2->QueryItem("select famousName from ".TABLESCHOLARS." where id='$chd'");
$chd1 =$child;
if ($upto>0)
{
$parts = explode(" ",$child);
$child="";
for ($j = 0; $j < $upto; $j++)
$child .= $parts[$j]." ";
}
$chd = "".$child."";
}
else
{
$child = $chd;
if ($upto>0)
{
$parts = explode(" ",$child);
$child="";
for ($j = 0; $j < $upto; $j++)
$child .= $parts[$j]." ";
if (count($parts)>$upto)
$chd = "".$child."";
}
}
$chds .= $chd." ";
$count++;
$width=max($width,strlen($child));
}
$entry['count'] = $count;
$entry['width'] = $width;
$entry['child'] = $chds;
return ($entry);
}
function findTeachers($sql2,$sId,$field,$arabic=0,$type=0)
{
GLOBAL $colors;
$name = "";
$IDs="";
$comma = "";
$comma2 = " ";
$count=0;
$query = "select id, famousName,otherName from ".TABLESCHOLARS." where concat(',',$field,',') like '%,$sId,%' order by Id";
$sql2->Query ("SET NAMES 'utf8'");
$sql2->Query ($query);
$rows = $sql2->rows;
for ($kk = 0; $kk < $rows; $kk++)
{
$sql2->Fetch($kk);
$sid = $sql2->data[0];
$rk = (int)($sid/10000) + 1;
$color = $colors[$rk];
$nm = $sql2->data[$arabic + 1];
$name .= $comma."".$nm."";
$IDs .=$comma.$sid;
$comma = ",";
$count++;
//if ($count>5) break;
}
if ($type==0) return($name); else return($name." ".$IDs);
}
function birthDeath($dob, $dod, $rk, $tb)
{
$fix="";
$fix2="";
//DOB
$dobh = trim(strtok($dob, "/"));
$dobg = trim(strtok("*"));
$dobg = trim(strtok($dobg, " "));
$date[0]['G'] = $dobg;
$date[0]['H'] = $dobh;
//$tb = $sql->data[5];
//$tb= $sql2->QueryItem("select tabqa from ".TABLETAQRIB." where scholarId=$sid");
//if ($tb<4) $tb=0; else $tb -= 3;
$fs = substr($dobh,0,1);
if ($fs=="~" || $fs=="<" || $fs==">") $dobh = trim(substr($dobh,1));
if ($fs=="a") $dobh = trim(substr($dobh,5));
if ($fs=="b") $dobh = trim(substr($dobh,6));
$dobh = trim(strtok($dobh, " "));
$cbh = trim(strtok("*"));
$sbe=1;
$sb=1;
$dobhe = 20 + 80 * ($rk-2);
if ($tb>1) $dobhe = ($tb-1)*20 - 10;
if ($rk==1) {$dobhe = -10; $sbe=1; }
$date[0]['est']=0;
if ($dobh==0 && $rk>1) { $dobh = $dobhe ; $fix .="«"; $date[0]['est']=1;}
if ($dobh==0 && $rk==1) { $dobh = abs($dobhe); $cbh="BH"; $fix .="«"; $date[0]['est']=1;}
$signb = "";
$signd = "";
if (substr($cbh,0,2)=="BH") {$signb = "-"; $sb=-1;} else $cbh="AH";
$jdb = (int)(islamicToJd($sb*$dobh, 6, 15)/365.25) - 4713;
$jdbe = (int)(islamicToJd($sbe*$dobhe, 6, 15)/365.25) - 4713;
if ($dobg==0) $dobg=$jdb;
$dobg = sprintf("%04d",$dobg);
$dobh = $signb.sprintf("%04d",$dobh);
$date[0]['HA'] = $dobh;
$date[0]['GA'] = $dobg;
$date[0]['GC'] = $jdb;
$date[0]['HE'] = $dobhe;
$date[0]['GE'] = $jdbe;
//DOD
$dodh = trim(strtok($dod, "/"));
$dodg = trim(strtok("*"));
$dodg = trim(strtok($dodg, " "));
$date[1]['G'] = $dobg;
$date[1]['H'] = $dobh;
$fs = substr($dodh,0,1);
if ($fs == "~" || $fs == "<" || $fs == ">") $dodh = trim(substr($dodh,1));
if ($fs == "a") $dodh = trim(substr($dodh,5));
if ($fs == "b") $dodh = trim(substr($dodh,6));
//$fs = $dodh;
$dodh = trim(strtok($dodh, " "));
$cdh = trim(strtok("*"));
$sd=1;
$sde=1;
if (substr($cdh,0,2)=="BH") {$signd = "-"; $sd=-1;} else $cdh="AH";
$dodhe = 40 + 80 * ($rk-1);
if ($tb>0) $dodhe = 60 + ($tb-1)*20;
$date[1]['est']=0;
if ($dodh==0 && $rk>0 && $signd=="") { $dodh = $dodhe; $fix2 .="»"; $date[1]['est']=1;}
$jdd = (int)(islamicToJd($sd*$dodh, 6, 15)/365.25) - 4713;
$jdde = (int)(islamicToJd($sde*$dodhe, 6, 15)/365.25) - 4713;
if ($dodg<$dobg) $dodg=$jdd;
$dodg = sprintf("%04d",$dodg);
$dodh = $signd.sprintf("%04d",$dodh);
$date[1]['HA'] = $dodh;
$date[1]['GA'] = $dodg;
$date[1]['GC'] = $jdd;
$date[1]['HE'] = $dodhe;
$date[1]['GE'] = $jdde;
$dbda = "[".abs($date[0]['HA'])." $cbh/".$date[0]['GA']." CE - ".abs($date[1]['HA'])." $cdh/".$date[1]['GA']." CE] (Cal.)";
$date[0][0] = $dbda;
return($date);
}
function utf8_strrev($str){
preg_match_all('/./us', $str, $ar);
return join('',array_reverse($ar[0]));
}
function islamicToJd($year, $month, $day)
{
$_ISLAMIC_EPOCH = 1948439.5;
return($day + ceil(29.5 * ($month - 1)) + ($year - 1) * 354 + (int)((3 + (11 * $year)) / 30) + $_ISLAMIC_EPOCH) - 1;
}
class ArDate
{
protected $mode = 1;
protected $xml = null;
protected static $islamicEpoch = 1948439.5;
/**
* "date" method output charset
* @var String
*/
public $dateOutput = 'utf-8';
/**
* Convert given Gregorian date into Hijri date
*
* @param integer $Y Year Gregorian year
* @param integer $M Month Gregorian month
* @param integer $D Day Gregorian day
*
* @return array Hijri date [int Year, int Month, int Day](Islamic calendar)
* @author Khaled Al-Sham'aa
*/
public function hjConvert($Y, $M, $D)
{
// To get these functions to work, you have to compile PHP
// with --enable-calendar
// http://www.php.net/manual/en/calendar.installation.php
// $jd = GregorianToJD($M, $D, $Y);
$jd = $this->gregToJd($M, $D, $Y);
list($year, $month, $day) = $this->jdToIslamic($jd);
return array($year, $month, $day);
}
/**
* Convert given Julian day into Hijri date
*
* @param integer $jd Julian day
*
* @return array Hijri date [int Year, int Month, int Day](Islamic calendar)
* @author Khaled Al-Sham'aa
*/
protected function jdToIslamic($jd)
{
$jd = (int)$jd + 0.5;
$year = ((30 * ($jd - self::$islamicEpoch)) + 10646) / 10631;
$year = (int)$year;
$month = min(12, ceil(($jd - (29 + $this->islamicToJd($year, 1, 1))) / 29.5)
+ 1);
$day = ($jd - $this->islamicToJd($year, $month, 1)) + 1;
return array($year, $month, $day);
}
/**
* Convert given Hijri date into Julian day
*
* @param integer $year Year Hijri year
* @param integer $month Month Hijri month
* @param integer $day Day Hijri day
*
* @return integer Julian day
* @author Khaled Al-Sham'aa
*/
public function islamicToJd($year, $month, $day)
{
return($day + ceil(29.5 * ($month - 1)) + ($year - 1) * 354 +
(int)((3 + (11 * $year)) / 30) + self::$islamicEpoch) - 1;
}
/**
* Converts a Gregorian date to Julian Day Count
*
* @param integer $m The month as a number from 1 (for January)
* to 12 (for December)
* @param integer $d The day as a number from 1 to 31
* @param integer $y The year as a number between -4714 and 9999
*
* @return integer The julian day for the given gregorian date as an integer
* @author Khaled Al-Sham'aa
*/
protected function gregToJd ($m, $d, $y)
{
if ($m > 2) {
$m = $m - 3;
} else {
$m = $m + 9;
$y = $y - 1;
}
$c = $y / 100;
$ya = $y - 100 * $c;
$jd = (146097 * $c) / 4 + (1461 * $ya) / 4 +
(153 * $m + 2) / 5 + $d + 1721119;
return round($jd);
}
}
function isMaster($host)
{
$hosts = explode(".",$host,5);
//50-15-103-13.hou.clearwire-wmx.net
//50-8-24-38.hou.clearwire-wmx.net
$master=0;
//echo $host." ";
if (($hosts[2]=="hstntx" && $hosts[3]=="swbell") || ($hosts[0]=="50-8-24-38"))
{
$master=1;
}
return($master);
}
function adslashes($abc)
{
return(addslashes($abc));
}
?>
$Ranks = array("Rasool Allah", "Comp.(RA)","Follower(Tabi')","Succ. (Taba' Tabi')","3rd Century AH","4th Century AH","5th Century AH",
"6th Century AH","7th Century AH","8th Century AH","9th Century AH","10th Century AH","11th Century AH","12th Century AH",
"13th Century AH","14th Century AH","15th Century AH");
$Ranks2 = array("Rasool Allah", "Companion (RA)","Follower (Tabi')","Successor (Taba' Tabi')","3rd Century AH","4th Century AH","5th Century AH",
"6th Century AH","7th Century AH","8th Century AH","9th Century AH","10th Century AH","11th Century AH","12th Century AH",
"13th Century AH","14th Century AH","15th Century AH");
$Interests = array("Unknown", "Tafsir/Quran","Recitation/Quran","Hadith","Narrator","Fiqh","Aqeedah","History","Seerah","Theology", //0-9
"Medicine","Science","Mathematics","Economics","Art/Poetry","Explorer","Commander","Khalifah","Governor","Qadhi(Judge)",//10-19
"Reformer","Thinker","Linguistic","Traditionalist","Preacher","Politics"); //20-25
$Subjects = array("Unknown", "Tafsir/Quran","Recitation/Quran","Hadith","Akhlaq","Fiqh","Aqeedah","History","Seerah","Theology","Philosphy","Politics",
"Medicine","Science","Mathematics","Economics","Art/Peotry","Comparative Religon","Biography");
//$iconFiles = array("saw23X22.gif", "rah3.gif");
$iconFiles = array("saw23X22.gif", "rah27X23.gif");
//$iconFiles = array("saws.gif", "ranhu.gif");
$muthhubs = array("None", "Hanafi","Maliki","Shafi'ee","Hanbali","Other","Unknown","Non-Muslim");
$narratorGrade = array("Unknown", "No Doubt","Thiqah Thiqah","Thiqah","Sadooq","Sadooq/Delusion","Maqbool", //0 - 6
"Not Thiqah","Weak","Unknown-Majhool","Abandoned","Accused Liar","Liar","Undefined"); //7-13
$counts = array("Companions (Sahaba, RA)","Followers (Tab'aeen)","Successors (Taba' Tab'aeen)","3rd Century (Taba' Taba' Tab'aeen)","Later Scholars","Tafsir Scholars","Historians");
$colors = array("black","darkgreen","blue","purple","brown","magenta");
$tribes = array("Banu Hashim","Banu al-Muttalib","Banu Nawfal","Banu 'Abd Shams","...Banu Umayya","Banu Asad","Banu 'Abd al-Dar",
"Banu Zuhrah","Banu Makhzum","Banu Taym","Banu Jumah","Banu Sahm","Banu 'Adi","Banu 'Amir b. Lu'ayy","Banu al-Harith b. Fihr");
$tribesAbbr = array("B.Hashim","B.al-Muttalib","B.Nawfal","B.'Abd Shams","B.Umayya,","B.Asad","B.'Abd al-Dar",
"B.Zuhrah","B.Makhzum","B.Taym","B.Jumah","B.Sahm","B.'Adi","B.'Amir","B.Fihr");
$ansarsAbbr = array("B.al-Harith B.al-Khazraj","B.'Auf B.al-Khazraj","B.QauQal","B.al-Hubla","B.Sa'ida","B.Salima","B.Zurayq","B.Bayada","B.Habib",
"B.Malik B.al-Najjar","B.Mazin B.al-Najjar","B.'Ady B.al-Najjar","B.Dinar B.al-Najjar");
$ansarsAbbrStr = array("B.al-Harith B.al-Khazraj","B.'Auf B.al-Khazraj","...B.QauQal","...B.al-Hubla","B.Sa'ida","B.Salima","B.Zurayq","B.Bayada","B.Habib",
"B.Malik B.al-Najjar","B.Mazin B.al-Najjar","B.'Ady B.al-Najjar","B.Dinar B.al-Najjar");
$awsAbbr = array("B.'Abdul Ashhal","B.Haritha","B.Zafar","B.'Amr B.'Auf","B.Dubay'a","B.Umayyah B.Zayd","B.'Ubaid B.Zayd","B.Mu'awiya",
"B.Tha'laba","B.Jahjaba B.Kulfa","B.Ghanm B.al-Salm","B.Khutama");
$awsAbbrStr = array("B.'Abdul Ashhal","B.Haritha","B.Zafar","B.'Amr B.'Auf","...B.Dubay'a","...B.Umayya B.Zayd","...B.'Ubaid B.Zayd","...B.Mu'awiya",
"...B.Tha'laba","...B.Jahjaba B.Kulfa","B.Ghanm B.al-Salm","B.Khutama");
//$hadithBooks = array("Sahih Bukhari","Sahih Muslim");
$hadithBooks = array("Sahih Bukhari","Sahih Muslim","Sunan Abi Da'ud","Jami' al-Tirmidhi",
"Sunan an-Nasa'i","Sunan Ibn Majah","Riyad as-Salihin");
$hadithStatus = array("Unknown","Sahih","Hasan","Da'if","Gharib","Hasan Gharib","Sahih li ghairih","Hasan Sahih Gharib","Hasan Sahih","Fabricated", "Munkar");
$genderType = array("Unknown","","Woman","Kunya,","Kunya, Woman");
$Tags = array("Early Muslim","Late Muslim","Female","Freed Slave","Tortured","Abyssinia","Abyssinia 1","Abyssinia 2","Aqaba 1","Aqaba 2",
"Aqaba Chief","Quraish","Emigrant","Ansar","Badr","Uhud","Khandaq","Khaybar","Promised Paradise","Mother of the Believers","Child","Uncle","Aunt","Scribe","Messenger","Servant","Client");
$tabaqatLevel = array("Comp.(RA)","Successor (Level 1)","Successor (Level 2)","Successor (Level 3)","Successor (Level 4)",
"Successor (Level 5)","Successor (Level 6)","Successor (Level 7)","Successor (Level 8)","Successor (Level 9)","Fiqh/Hadith Scholar");
$resources = array("al-Isabah Ibn Hajr","Thiqat Ibn Hibban","Tarikhul Kabir al-Bukhari","Tabaqat Ibn Sa'd",
"Siyar A'lam al-Dhahbi","Lisan al-Mizan Ibn Hajr","Tahdheeb al-Tahdheeb Ibn Hajr",
"Mezan al-A'tadal al-Dhahbi","Taqrib al-Tahdheeb Ibn Hajr", "Tahdheeb al-kamal by al-Mizzi","Thiqat/Tarikh");
$resource_book = array("al-Isabah","Thiqat","Tarikh-ul Kabir","Tabaqat","Siyar A'lam","Lisan al-Mizan","Tahdheeb al-Tahdheeb","Mezan al-A'tadal","Taqrib al-Tahdheeb","Tahdheeb al-kamal");
$tables = array(TABLEASABAH,TABLEALTHKAT,TABLETARIKH,TABLEIBNSAD,TABLESEER,TABLEMIZAN,TABLETAHZEEB,TABLEMEZAN, TABLETAQRIB, TABLEKAMAL);
$adjustArabicName = array(3,4,5,8,9,7,10,11,12);
$resource_book_color2 = array("black","magenta","orange","blue","darkgreen","black","purple","brown","yellow","darkblue");
$resource_book_color = array("black","black","black","black","black","black","black","black","black", "black");
$Towns="Hijaz Makkah Medina al-Ta'if Yamama Iraq Kufa Basra Baghdad Wasit Bahrain Musal Egypt Alexandria Abyssinia Syria Damascus Hims Jordon Ramla Palestine Antioch Arminia Yemen Hamadan Sana' Khurasan Merv Ray' Raqqa Mada'in Musaysa 'Asqalan Tursus Bulkh Asbahan Nisapur Balsi Nisa' al-Thaghar Bukhara Samarqand Others";
?>
Islam Time Line
include_once("searchbar2.php");
//$cond = str_replace(";",",",$cond);
//$abc = str_word_count($cond,0,",");
print("